<template>
  <page-header-wrapper>
    <page-tab-list></page-tab-list>
    <a-card :border='false'>

      <div v-loading='loading'>
        <a-col :span='11'>
          <a-alert
            message='该功能需要到微信公众平台(开发管理->开发设置->扫普通链接二维码打开小程序)中进行配置'
            banner
          />
          <br />
          <a-alert banner :showIcon='false' type='warning'>
            <template slot='message'>
              <div>协议类型: https</div>
              <div>选择大小写: 小写</div>
              <div>二维码规则: https://{{ qrcodeRule }}
                <a-icon type='copy' @click='copyContent(qrcodeRule)' />
              </div>
              <div>前缀占用规则: 不占用</div>
              <div>
                小程序功能页面: alipay-order/orderMeal/orderMeal
                <a-icon type='copy' @click="copyContent('alipay-order/orderMeal/orderMeal')" />
              </div>
            </template>
          </a-alert>
        </a-col>
        <a-col :span='2'></a-col>
        <a-col :span='11'>
          <a-alert
            message='该功能需要到支付宝开放平台(选择应用->审核&发布->小程序码->关联普通二维码)中进行配置'
            banner
          />
          <br />
          <a-alert banner :showIcon='false' type='warning'>
            <template slot='message'>
              <div>匹配规则: 模糊匹配</div>
              <div>二维码地址: https://{{ qrcodeRule }}
                <a-icon type='copy' @click='copyContent(qrcodeRule)' />
              </div>
              <div>
                小程序功能页: alipay-order/orderMeal/orderMeal
                <a-icon type='copy' @click="copyContent('alipay-order/orderMeal/orderMeal')" />
              </div>
            </template>
          </a-alert>
        </a-col>
      </div>
    </a-card>
  </page-header-wrapper>
</template>
<script>
import storage from 'store'

export default {
  name: 'FoodSetting',
  data() {
    return {
      form: {
        appkey: '',
        app_secret: ''
      },
      btnLoading: false
    }
  },
  created() {
  },
  computed: {
    qrcodeRule: function() {
      return window.location.host + '/web/food/saas'
    }
  },
  methods: {
    copyContent: function(text) {
      this.$copyText(text)
        .then(e => {
          this.$message.success('复制成功')
        })
        .catch(err => {
          console.log(err)
          this.$message.error('复制失败')
        })
    }
  }
}
</script>
<style scoped>
.box {
  background: #fff;
}
</style>
